:-modeh(uncle(+person, -person)).
:-modeb(1, male(+person)).
:-modeb(1, parent(-person, +person)).

 % careful, parent(-person, +person)) has to appear before parent(+person, -person))
 % in the mode declaration, otherwise TopLog does not find the hypothesis
 % This is because it tries the literals according to their appearance order in the mode declarations

:-modeb(2, parent(+person, -person)).

:-set(maximum_literals_in_hypothesis, 4).

% target concept: uncle(X, Y):- male(X), parent(Z, X), parent(Z, W), parent(W, Y).
% target concept: uncle(X, Y):- brother(X, Z), parent(Z, Y).

%brother(X,Y):-
%  male(X, Y),
%  parent(Z, X),
%  parent(Z, Y).

example(uncle(bob, ann), 10).

example(uncle(bob, susan), -10).
example(uncle(betty, ann), -10).
example(uncle(tim, susan), -10).
example(uncle(tom, betty), -10).
example(uncle(susan, betty), -10).
example(uncle(joyce, ann), -10).
example(uncle(tim, joyce), -10).
example(uncle(tom, mary), -10).

male(bob).
male(tom).
male(tim).

female(ann).
female(mary).
female(susan).
female(betty).
female(joyce).

parent(tom, mary).
parent(tom, betty).
parent(tom, bob).
parent(mary, ann).
parent(joyce, susan).
parent(tom, tim).

